{assign var="rand1" value=0|rand:10000}
{assign var="rand2" value=0|rand:10000}

{assign var="row_id" value="row_`$obj.obj_id`_`$rand1`_`$rand2`}

<h4 class="line">
	<span style="float:left;" onclick="CMS.open_upload('{$row_id}')">{$content.title}</span>
	<span style="float:right">
		<a href="javascript:void(0);" onclick="CMS.open_upload('{$row_id}')">{strip}
			{if 'closed' == $content.style}
			<img src="img/icon-formtype-open.gif" style="padding:0;margin:0;" id="{$row_id}_upload_switch" vspace="0" hspace="0" border="0" alt="" />
			{else}
			<img src="img/icon-formtype-close.gif" style="padding:0;margin:0;" id="{$row_id}_upload_switch" vspace="0" hspace="0" border="0" alt="" />
			{/if}
		{/strip}</a>
	</span>
	<div class="clear" style="margin:0;"></div>
</h4>
<div id="{$row_id}_upload" {if 'closed' == $content.style}style="display:none"{/if}>
	{foreach name="formfieldrowloop" item="field" from=$content.children}
			{if file_exists("`$CMS_TPL_DIR`forms/`$field.tpl_file`")}
				{include file="`$CMS_TPL_DIR`forms/`$field.tpl_file`" content=$field obj=$obj prefix="obj[`$obj.obj_id`]" aFormFields=$aFormFields i=$smarty.foreach.formfieldrowloop.iteration}
			{else}
				<strong>MISSING template file &laquo; {$CMS_TPL_DIR}forms/{$field.tpl_file} &raquo;</strong> for formtype: {$field.formtype}<br />
			{/if}
	{/foreach}
	<br style="clear:both;" />
</div>